﻿<%@ Page Title="" Language="C#" MasterPageFile="~/administrator/backend.Master" AutoEventWireup="true"
    CodeBehind="test-part-add.aspx.cs" Inherits="VQWEB.administrator.english.tests.test_part_add" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Content_backend" runat="server">
    <form id="frm_testpart" runat="server" role="form">
    <asp:FormView ID="frmTestPart" runat="server" RenderOuterTable="false" 
        onitemcreated="frmTestPart_ItemCreated">
        <EditItemTemplate>
            <div class="row">
                <div class="col-md-6">
                 <div class="form-group">
                <label>
                    Test</label>
            <asp:Literal ID="ltrTest" runat="server" />
            </div>
            <div class="form-group">
                <label>
                    Phan thi</label>
                <input class="form-control" name="part_test_title" type="text" value='<%# Eval("part_test_title") %>' />
            </div>
            <div class="form-group">
                <label>
                    Noi dung</label>
                <textarea class="form-control" cols="3" name="part_test_content" rows="3"><%# Eval("part_test_content")%></textarea>
            </div>
            <div class="form-group">
                <label>
                    Files</label>
                <input class="form-control" id="get_files" name="part_test_file" type="text" value='<%# Eval("part_test_file") %>' />
            </div>
            <div class="checkbox">
                <label>
                    <input <%# Eval("part_test_active") !=null && (bool)(Eval("part_test_active")) ? " checked='checked'" : null %> 
                        name="part_test_active" type="checkbox" value="True" />
                    Active
                </label>
            </div>
            <input name="part_test_id" type="hidden" value='<%# (Eval("part_test_id") != null) ? Eval("part_test_id") : "0" %>' />
                </div>
                 <div class="col-md-6">
                 <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">
                                Group</h3>
                        </div>
                        <div class="panel-body">
                             <asp:Literal ID="ltrGroup" runat="server" />
                        </div>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">
                                Excercise</h3>
                        </div>
                        <div class="panel-body">
                             <asp:Literal ID="ltrExcercise" runat="server" />
                        </div>
                    </div>
                </div>

                 
                </div>
            

       
        </EditItemTemplate>
    </asp:FormView>
    </form>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Script_backend" runat="server">
    <script type="text/javascript">
        ShowToolBar("edit");
        var url_ashx = "/admin/english/test/handler";
        $("#btnCancel").live("click", function () {
            window.location = "/admin/english/test/part/list";
        });
        $("#btnSave").live("click", function () {
            var arr = $("#frm_testpart").serializeObject();
            $.post(url_ashx, { add_test_part: window.escape(arr) }, function (data) {
                alert(data);
                window.location = "/admin/english/test/part/list";
            });
        });
    </script>
</asp:Content>
